# Contributor: fossdd <fossdd@pwned.life>
maintainer="fossdd <fossdd@pwned.life>"
pkgname=gnome-user-share
pkgver=47.0
pkgrel=0
pkgdesc="Easy to use user-level file sharing for GNOME"
url="https://gitlab.gnome.org/GNOME/gnome-user-share"
arch="all"
license="GPL-2.0-or-later"
depends="
	apache2
	apache2-webdav
	mod_dnssd
	"
makedepends="
	glib-dev
	meson
	"
subpackages="$pkgname-lang"
source="https://download.gnome.org/sources/gnome-user-share/${pkgver%.*}/gnome-user-share-$pkgver.tar.xz
	optional-systemd.patch
	define-list-of-libc-feature-test-macros.patch
	"
options="!check" # no tests

build() {
	abuild-meson \
		. output \
		-Dhttpd=/usr/sbin/httpd \
		-Dmodules_path=/usr/lib/apache2
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	# We don't ship systemd
	rm -r "$pkgdir"/usr/lib/systemd
}

sha512sums="
c92bcea1a160b0d137f0871e43eae85fb441476fdaec5d08d81ffe026dfd49138d5bb13d53b26bccfcf2dea13a11ad4704f18ea687d2a1e84fbfc5ebea29c475  gnome-user-share-47.0.tar.xz
25ca6f500d004f503e743b72f179585bd84c13318775f171909eab94b90573eff290df4f25becf93f7245904d7a46c773594d5bc8382a6483c7980b9de71f59f  optional-systemd.patch
dd6dd0f6cc4640f251cd68fd738f24637a39f3b79541c18df1c1ee33e197f1ee269f00641f342b7d9e0ac48dd6801487eeb012acc4148950dddc48f4772c4257  define-list-of-libc-feature-test-macros.patch
"
